<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let obj = {
            name: '卡莎',
            obj1: {
                myname: 'ls'
            }
        }
        // console.log(obj)
        // console.log(obj.age)
        // console.log(obj.obj1.obj2.age)
        // console.log(obj?.obj1?.obj2?.age)

        // 2.空合并运算符
        function fn(a, b) {
            var a = a ?? 1
            var b = b ?? 2
            console.log(a, b)
        }
        fn('   ', 0)
        fn(3, 4)
        fn(undefined, null)



    </script>
</body>
</html>